import fetch from '@/config/fetch'

// unicloud云函数URL化
// const unicloudApis = {
//     send_msg: 'https://fc-mp-a37055db-5363-4e63-9a10-3ddac686267f.next.bspapp.com/send_msg',
//     upload_files: 'https://fc-mp-a37055db-5363-4e63-9a10-3ddac686267f.next.bspapp.com/upload_files',
//     save_print_setting: 'https://fc-mp-a37055db-5363-4e63-9a10-3ddac686267f.next.bspapp.com/save_print_setting',
//     get_print_settings: 'https://fc-mp-a37055db-5363-4e63-9a10-3ddac686267f.next.bspapp.com/get_print_settings'
// }
// // 请求体
// async function sendRequest(request_url, data) {

//     let requestConfig = {
//         method: "POST",
//         headers: {
//             'Accept': 'application/json',
//             'Content-Type': 'application/json'
//         },
//         body: JSON.stringify(data)
//     }
//     const response = await fetch(request_url, requestConfig);
//     const responseJson = await response.json();
//     return responseJson
// }

// // 发送短信验证码
// export const sendMsg = data => sendRequest(unicloudApis.send_msg, data);
// // 上传附件
// export const uploadFiles = data => sendRequest(unicloudApis.upload_files, data);
// // 获取打印参数
// export const getPrintSettings = data => sendRequest(unicloudApis.get_print_settings, data);
// // 设置打印参数
// export const savePrintSetting = data => sendRequest(unicloudApis.save_print_setting, data);
// 发送短信验证码
export const sendMsg = data => fetch('/cloud_api/send_msg_jcy', data, 'POST');
// 上传附件(头像)
export const uploadFiles = data => fetch('/cloud_api/upload_files_jcy', data, 'POST');
// 上传附件（所有文件）
export const uploadAttachments = data => fetch('/cloud_api/attachment_upload', data, 'POST');
// 获取打印参数
export const getPrintSettings = data => fetch('/cloud_api/get_print_setting_jcy', data, 'POST');
// 设置打印参数
export const savePrintSetting = data => fetch('/cloud_api/save_print_setting_jcy', data, 'POST');
